package com.bluedon.ism.commons.action;

import com.bluedon.ism.commons.entity.Menu;
import com.bluedon.ism.commons.service.MenuService;
import net.sf.json.JsonConfig;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import javax.annotation.Resource;
import java.io.IOException;
import java.util.List;

/**
 * 菜单访问类
 */
public class MenuAction extends BaseAdminAction {
	private static final Log logger = LogFactory.getLog(MenuAction.class);

	@Resource(name = "menuService")
	private MenuService menuService;
	private Menu menu;

	public void findAdminMenuAll() throws IOException{
		List<Menu> list = menuService.getPcMenu(getSessionAid());
		JsonConfig config = new JsonConfig();
		config.setExcludes(new String[] {"permissions"});
		writeJSONArray(list, config);
	}
	

	public void setMenuService(MenuService menuService) {
		this.menuService = menuService;
	}



	public Menu getMenu() {
		return menu;
	}

	public void setMenu(Menu menu) {
		this.menu = menu;
	}
	
	

}
